<template>
  <div class="detail">
    <detailBanner :sightName="sightName" :bannerImg='bannerImg' :gallaryImgs="gallaryImgs"></detailBanner>
    <detailHeader></detailHeader>
    <div class="content">
      <detailList :list="list"></detailList>
      <detailCommend></detailCommend>
    </div>
  </div>
</template>

<script>
import detailBanner from './components/banner.vue'
import detailHeader from './components/header.vue'
import detailList from './components/list.vue'
import detailCommend from './components/commend.vue'
import axios from 'axios'
export default {
  name: 'DetailPage',
  components: { detailBanner, detailHeader, detailList, detailCommend },
  data () {
    return {
      list: [{
        title: '成人票',
        children: [{
          title: '成人馆三级联票'
        }, {
          title: '成人馆三级联票'
        }, {
          title: '成人馆三级联票'
        }, {
          title: '成人馆三级联票'
        }]
      },
      { title: '学生票' },
      { title: '特惠票' },
      { title: '儿童票' }],
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  methods: {
    getDetailInfo () {
      axios.get('/api/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then(res => {
        res = res.data
        if (res.ret && res.data) {
          const data = res.data
          // console.log(data)
          this.sightName = data.sightName
          this.bannerImg = data.bannerImg
          this.gallaryImgs = data.gallaryImgs
          this.list = data.categoryList
        }
      })
    }
  },
  mounted () {
    this.getDetailInfo()
  }
}
</script>

<style>
.content {
  height: 200000px;
}
</style>
